<template>
  <div class="area">
    <div class="bg">
      <div class="content">
        <MyButton />
        <div class="th">全国风险地区汇总</div>
        <template v-if="high.length > 0">
          <div class="title">
            <img src="../../assets/images/high.png" alt="" />
            高风险区{{ high.length }}个
          </div>
          <ul class="list">
            <li v-for="(item, index) in high" :key="index">
              {{ item }}
            </li>
          </ul>
        </template>
        <!-- 中风险 -->
        <template v-if="mid.length > 0">
          <div class="title">
            <img src="../../assets/images/mid.png" alt="" />
            中风险区{{ mid.length }}个
          </div>
          <ul class="list">
            <li v-for="(item, index) in mid" :key="index">
              {{ item }}
            </li>
          </ul>
        </template>
      </div>
    </div>
  </div>
</template>

<script>
import api from "../../api";
import MyButton from "../../components/MyButton/Mybutton.vue";
export default {
  data() {
    return {
      high: [], //高风险区数据
      mid: [], //低风险区域
    };
  },
  components: {
    MyButton,
  },
  methods: {
    backUp() {
      this.$router.go(-1);
    },
  },
  created() {
    api.getCovInfo().then((res) => {
      // console.log(res.data.newslist[0]);
      let riskarea = res.data.newslist[0].riskarea;
      //解析
      this.high = riskarea.high;
      this.mid = riskarea.mid;
    });
  },
};
</script>

<style lang="less" scoped>
.area {
  background: url("../../assets/images/fengxian1.webp") no-repeat;
  background-attachment: fixed;
  h2 {
    padding: 0 0.25rem;
  }
  .content {
    background: rgba(0, 0, 0, 0.1) fixed;
    border-radius: 0.2rem;
    padding: 0.25rem;
    color: rgb(252, 239, 239);

    .title {
      font-weight: 700;
      font-size: 0.35rem;
      img {
        width: 0.4rem;
        vertical-align: top;
      }
    }
    .th {
      margin-bottom: 0.3rem;
      font-size: 0.4rem;
      text-align: center;
    }
    .th:before {
      display: inline-block;
      width: 0.1rem;
      height: 0.3rem;
      margin-right: 0.1rem;
      background-color: #4169e2;
      content: "";
      vertical-align: middle;
    }
    .list {
      margin-bottom: 0.25rem;
      li {
        margin-bottom: 0.2rem;
        color: #333;
        background: #f7f7f791;
        padding: 0.1rem;
        border-radius: 0.1rem;
        letter-spacing: 0.01rem;
        line-height: 0.5rem;
      }
    }
  }
}
.anNiu {
  left: 87%;
}
</style>